import {defineStore} from "pinia"
import {getSetting} from "@/service/api"

// 定义state类型 (也可以不定义)
interface settingState {
    settings: any
    content: string | null,
    themeColor: string,

}

export const useSettingStore = defineStore("setting", {
    state: (): settingState => ({
        settings: {},
        content: "",
        themeColor: ""
    }),
    actions: {
        setSetting(val: any) {
            this.settings = val
            this.themeColor = val.theme_color
        }
    }
})
